module.exports = function log4jdemo() {
    var log4js = require('log4js');
    
    log4js.configure({
        appenders: {
            std: { type: "stdout", level: "all", layout: { type: "basic", } },
            file: { type: "file", filename: "log.txt", encoding: "utf-8" }
        },
        categories: {
            default: { appenders: ["std"], level: "debug" },
            custom: { appenders: ["std", "file"], level: "all" }
        }
    });

    var logger = log4js.getLogger();
    logger.addContext("context","value");
    logger.trace("Some trace messages");
    logger.debug("Some debug messages");
    logger.info("Some info messages");
    logger.warn("Some warn messages");
    logger.error("Some error messages");
    logger.fatal ("Some fatal messages");

    var logger1 = log4js.getLogger("custom");
    logger1.trace("Some trace messages");
    logger1.debug("Some debug messages");
    logger1.info("Some info messages");
    logger1.warn("Some warn messages");
    logger1.error("Some error messages");
    logger1.fatal ("Some fatal messages");

}